'use strict';
var jwt = require('jsonwebtoken');
const Controller = require('egg').Controller;

class PhoneController extends Controller {
  async phoneDetail(query) {
    const { id } = this.ctx.query;
    const data = {
      '00000001': {
        id: ['00000001-1', '00000001-2'],
        brand: '三星',
        type: 'Galaxy S',
        price: '2999.00',
        ram: '4GB',
        rom: '64GB',
        os: 'Android',
        description: '三星 Galaxy S 轻奢版（SM-G8750）4GB+64GB 移动联通电信4G手机',
        comment: '26万+',
        color: ['迷夜黑', '勃艮第红'],
        weight: '0.46kg',
        image: [
          'https://img12.360buyimg.com/n1/s450x450_jfs/t17521/206/2580110270/53998/1e541b83/5afcf165N08093d1a.jpg',
          'https://img12.360buyimg.com/n1/s450x450_jfs/t19732/312/2609842665/67556/c727387e/5afcf1a7Nceeff05d.jpg'
        ]
      },
      '00000002': {
        id: ['00000002-1', '00000002-2', '00000002-3', '00000002-4', '00000002-5'],
        brand: '华为',
        type: '荣耀10',
        price: '2399.00',
        ram: '4GB',
        rom: '64GB',
        os: 'Android',
        description: '荣耀10 GT游戏加速 AIS手持夜景 6GB+64GB 全网通 移动联通电信',
        comment: '46万+',
        color: ['幻夜黑', '海鸥灰', '幻影蓝', '幻影紫', '铃兰白'],
        weight: '0.46kg',
        image: [
          'https://img12.360buyimg.com/n1/s450x450_jfs/t17149/173/1779654602/189601/335d3d90/5ad8628dN03dc292f.jpg',
          'https://img10.360buyimg.com/n1/s450x450_jfs/t17773/222/1772357349/201925/627b888c/5ad8614bN7b9187f7.jpg',
          'https://img10.360buyimg.com/n1/s450x450_jfs/t18157/222/1822300674/231514/6c179af8/5ad87390N086a3c91.jpg',
          'https://img14.360buyimg.com/n1/s450x450_jfs/t17494/75/1869981719/216755/afe6bf7/5ad87250N8b8f157e.jpg',
          'https://img12.360buyimg.com/n1/s450x450_jfs/t22537/146/1691972730/217168/76bbe224/5b681abcNbaf7dc93.jpg'
        ]
      },
      '00000003': {
        id: ['00000003-1', '00000003-2', '00000003-3', '00000003-4'],
        brand: '小米',
        type: '小米8',
        price: '2699.00',
        ram: '6GB',
        rom: '64GB',
        os: 'Android',
        description: '小米8 全面屏游戏智能手机 6GB+64GB 全网通4G 双卡双待 拍照手机',
        comment: '28万+',
        color: ['黑', '白', '金', '蓝'],
        weight: '0.44kg',
        image: [
          'https://img10.360buyimg.com/n1/s450x450_jfs/t20569/241/521943946/338336/409b289f/5b0fcb56N90ae22f0.jpg',
          'https://img14.360buyimg.com/n1/s450x450_jfs/t21190/337/500784556/279395/cf39bbbf/5b0fca5aN0ecb5412.jpg',
          'https://img12.360buyimg.com/n1/s450x450_jfs/t20983/308/541244985/290069/4d2c41e/5b0fcd04N936b6971.jpg',
          'https://img10.360buyimg.com/n1/s450x450_jfs/t20569/241/521943946/338336/409b289f/5b0fcb56N90ae22f0.jpg'
        ]
      },
      '00000004': {
        id: ['00000004-1', '00000004-2', '00000004-3', '00000004-4'],
        brand: '苹果',
        type: 'iphone8',
        price: '4599.00',
        ram: '2GB',
        rom: '64GB',
        os: 'ios',
        description: 'Apple iPhone 8 64GB 移动联通电信4G手机',
        comment: '86万+',
        color: ['红色', '金色', '深空灰色', '银色'],
        weight: '0.44kg',
        image: [
          'https://img14.360buyimg.com/n1/s450x450_jfs/t19342/199/1516671468/71132/8e37293d/5acc524cN424bbaa0.jpg',
          'https://img10.360buyimg.com/n1/s450x450_jfs/t9085/22/907696059/71305/93f88c62/59b85847N20776d8e.jpg',
          'https://img12.360buyimg.com/n1/s450x450_jfs/t7582/66/3048380492/71753/acde79b5/59b85824N836bb714.jpg',
          'https://img14.360buyimg.com/n1/s450x450_jfs/t9025/340/884104341/73996/7c03cf2d/59b85817Nac76b256.jpg'
        ]
      },
      '00000005': {
        id: ['00000005-1', '00000005-2'],
        brand: '三星',
        type: 'Galaxy On5（G5500）',
        price: '719.00',
        ram: '1GB',
        rom: '8GB',
        os: 'Android',
        description: '三星（SAMSUNG） Galaxy On5（G5500）移动联通4G手机 智能老人机手机',
        comment: '200+',
        color: ['月莹白', '流沙金'],
        weight: '0.25kg',
        image: [
          'https://img10.360buyimg.com/n1/s450x450_jfs/t9385/233/1415397580/251022/3deb2824/59b8cb9bN0ce11eb8.jpg',
          'https://img11.360buyimg.com/n1/s450x450_jfs/t8932/100/1234110689/377336/dc8b8789/59b8cb81Nbbefec5e.jpg'
        ]
      },
      '00000006': {
        id: ['00000006-1', '00000006-2'],
        brand: 'oppo',
        type: 'Find X',
        price: '4999.00',
        ram: '8GB',
        rom: '128GB',
        os: 'Android',
        description: 'OPPO Find X曲面全景屏 8GB+128GB 全网通 移动联通电信全网通',
        comment: '31万+',
        color: ['波尔多红', '冰珀蓝'],
        weight: '0.59kg',
        image: [
          'https://img13.360buyimg.com/n1/s450x450_jfs/t23167/95/285071867/94556/c98fa4f6/5b2b6212N106d8382.jpg',
          'https://img12.360buyimg.com/n1/s450x450_jfs/t22597/146/281784588/98444/7399d046/5b2b6269N6d9b4743.jpg'
        ]
      },
      '00000007': {
        id: ['00000007-1', '00000007-2', '00000007-3'],
        brand: '小米',
        type: '小米MIX2S',
        price: '3299.00',
        ram: '6GB',
        rom: '128GB',
        os: 'Android',
        description: '小米MIX2S 全面屏游戏手机 6GB+128GB 全网通4G 陶瓷手机',
        comment: '28万+',
        color: ['黑', '白', '翡翠色'],
        weight: '0.59kg',
        image: [
          'https://img13.360buyimg.com/n1/s450x450_jfs/t17584/101/1073608607/187306/da89b445/5ab9e81aNd49ea317.jpg',
          'https://img13.360buyimg.com/n1/s450x450_jfs/t16882/177/1061113255/179245/ec830987/5ab9e7fbNe741eb71.jpg',
          'https://img11.360buyimg.com/n1/s450x450_jfs/t24673/3/265229373/117727/740c5111/5b6a6467N8aac10e4.jpg'
        ]
      },
      '00000008': {
        id: ['00000008-1', '00000008-2'],
        brand: '苹果',
        type: 'iPhone X',
        price: '7199.00',
        ram: '3GB',
        rom: '64GB',
        os: 'ios',
        description: 'Apple iPhone X (A1865) 64GB 银色 移动联通电信4G手机',
        comment: '79万+',
        color: ['银色', '深空灰色'],
        weight: '0.44kg',
        image: [
          'https://img10.360buyimg.com/n1/s450x450_jfs/t7297/154/3413903491/65679/45ae4902/59e42830N9da56c41.jpg',
          'https://img13.360buyimg.com/n1/s450x450_jfs/t10675/253/1344769770/66891/92d54ca4/59df2e7fN86c99a27.jpg'
        ]
      }
    }
    this.ctx.body = data[id];
  }
}

module.exports = PhoneController;
